package com.rd.student.jiaji.class3.wangyanbo.task27;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;

public class TestIn {
    public static void main(String[] args) throws Exception{
        //System.in是InputStream
//        Scanner scanner = new Scanner(System.in);
//        System.out.println();
        InputStream is = System.in;
        InputStreamReader reader = new InputStreamReader(is);
        BufferedReader br = new BufferedReader(reader);
        //逐层转化 先获取InputStream 然后获取InputStreamReader（转换流）
        //最后再获取BufferedReader
        String line = null;
        while (true){
            line = br.readLine();
            if (line == null) break;
            if (line.equals("exit")){
                System.exit(0);
            }
            System.out.println(line);
        }
        reader.close();
        br.close();
    }
}
